package c.x.jy.dao.dao;

import c.x.jy.dao.entity.SysUserEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;

import java.util.List;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

/**
 * 系统用户
 * 
 * @author amwhyh
 * @email xxx@xx.com
 * @date 2021-05-20 20:20:23
 */
@Mapper
public interface SysUserDao extends BaseMapper<SysUserEntity> {
	@Select("<script>  SELECT DISTINCT m.perms from sys_menu  m LEFT JOIN sys_role_menu  srm on srm.menu_id=m.menu_id LEFT JOIN sys_user_role sur on sur.role_id=srm.role_id where m.type =2  " +
			" <if test='userId != null'> and sur.user_id=${userId} </if> </script> ")
	List<String> queryAllPerms(Long userId);
	@Select("SELECT * from sys_user where username='${username}'" )
	SysUserEntity queryByUserName(String username);

 
	
}

